package com.books.service.hotrecommend.impl;

import com.books.mapper.hotrecommend.DigestMapper;
import com.books.model.entity.hotrecommend.Digest;
import com.books.service.hotrecommend.IDigestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @Author 饿熊的咆哮
 * @Date 2021/10/8 18:41
 * @Version 1.0
 */
@Service
@Transactional
public class DigestServiceImpl implements IDigestService {
    @Autowired(required = false)
    private DigestMapper digestMapper;

    @Override
    public List<Digest> findAll() {
        List<Digest> digests = digestMapper.findAll();
        return digests;
    }

    @Override
    public List<Digest> findByClassify(String classify) {
        List<Digest> digests = digestMapper.findByClassify(classify);
        return digests;
    }

    @Override
    public void addDigest(Digest digest) {
        digestMapper.addDigest(digest);
    }

    @Override
    public void delByContentId(Integer contentId) {
        digestMapper.delByContentId(contentId);
    }
}
